<?php

namespace app\admin\controller;
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept,fs-token");
header('Access-Control-Allow-Methods: GET, POST');
use think\Controller;
use think\Request;

/**
 * @title 城市管理
 * @group Admin
 */
class City extends Base
{
    /**
     * @title 根据关键字查询城市
     * @author 开发者
     * @url /admin/city/getCity
     * @method POST/GET
     * @description 根据关键字查询城市
     * @param name:name require:1 default:null type:varchar desc:关键字
     * @return Cid:城市id
     * @return Ccode:城市编码
     * @return Cname:城市名称
     * @return ProvinceCode:城市对应的省编码
     */
    public function getCity()
    {
        $name = input('name');
        $result = db('city')->where('Cname','like',"%{$name}%")->select();
        $this->apiReturn(200,'查询成功',$result);
    }

}
